<template>
  <div>
    <Modal
      :value="modalState"
      :title="title"
      :loading="loading"
      :footer-hide="true"
      @on-cancel="cancel"
      width="35%">
      <div style="text-align: center; margin-top: 40px; font-size: 23px;">
        <div>{{messageReadList && messageReadList.title ? messageReadList.title : ''}}</div>
      </div>
      <div style="margin-top: 40px;">
        <span style="display: inline-block; margin-left: 15%; font-size: 15px;">发送时间：{{messageReadList && messageReadList.ctime ? messageReadList.ctime : '-'}}</span>
        <span style="display: inline-block; margin-left: 15%;  font-size: 15px;">发送人：{{messageReadList && messageReadList.sender ? messageReadList.sender : '-'}}</span>
      </div>
      <div style="margin-left: 20%; margin-top: 60px; height: 250px;">
        <div style="font-size: 15px;">本次内容：</div>
        <div style="font-size: 14px; margin-top: 5px; margin-left: 5%;">{{messageReadList && messageReadList.content ? messageReadList.content : '-'}}</div>
      </div>
    </Modal>
  </div>
</template>
<script>
import {
  mapActions,
  mapState
} from 'vuex'
export default {
  name: 'MessageModal',
  data () {
    return {
      title: '',
      loading: true,
      ruleInline: {
        // name: [
        //   { required: true, message: '姓名不能为空', trigger: 'blur' }
        // ],
        // tel: [
        //   { required: true, message: '手机号不能为空', trigger: 'blur' }
        // ]
      }
    }
  },
  updated () {
    // if (this.row.id && this.row.id !== '') {
    //   this.title = '编辑banner'
    // } else {
    //   this.title = '添加banner'
    // }
  },
  computed: {
    ...mapState({
      row: state => state.message.row,
      messageReadList: state => state.message.messageReadList,
      modalState: state => state.modal.modalState
    })
  },
  methods: {
    ...mapActions(['updateModalState']),
    changeLoading () {
      this.loading = false
      this.$nextTick(() => {
        this.loading = true
      })
    },
    cancel () {
      this.updateModalState(false)
    }
  }
}
</script>
